package com.wzy.job;

import java.util.Date;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Jobs {

	public final static long  OneMinute=  60 * 1000;

    @Scheduled(fixedDelay=OneMinute)    
	public void fixedDelayJob() throws InterruptedException {
		
    	System.out.println("fixedDelayJob------------>" + new Date());
    	Thread.sleep(1000);
	}
    
    @Scheduled(fixedRate=OneMinute) 
    public void fixedRateJob() throws InterruptedException {
    	System.out.println("fixedRateJob------------>" + new Date());
    	Thread.sleep(1000);
    }
    
    @Scheduled(cron="0 15 16 * * ?")
    public void cronJob() {
    	System.out.println("cronJob------------>" + new Date());
    }
}
